import java.io.Serializable;
import java.util.StringTokenizer;


public class Person implements Serializable
{
	private int Id;
	private String FName;
	private String LName;
	private int Age;
	
	public Person (){}
	
	public Person (int Id, String FName, String LName, int Age)
	{
		this.Id = Id;
		this.FName = FName;
		this.LName = LName;
		this.Age = Age;
	}

	public int getId()
	{
		return Id;
	}
	
	public void setId( int Id )
	{
		this.Id = Id;
	}

	public String getFName()
	{
		return FName;
	}
	
	public void setFName( String FName )
	{
		this.FName = FName;
	}

	public String getLName()
	{
		return LName;
	}
	
	public void setLName( String LName )
	{
		this.LName = LName;
	}

	public int getAge()
	{
		return Age;
	}
	
	public void setAge( int Age )
	{
		this.Age = Age;
	}

	
	@Override
	public String toString() 
	{
		String str = "";
		str += Id + ";";
		str += FName + ";";
		str += LName + ";";
		str += Age;
		return str;
	}

	public String toSqlString() 
	{
		String str = "";
		str += Id + ",";
		str += "'" + FName + "',";
		str += "'" + LName + "',";
		str += Age;
		return str;
	}
	public void fromString(String str) 
	{
		StringTokenizer st = new StringTokenizer(str, ";");
		
		Id = Integer.parseInt( st.nextToken() );
		FName = st.nextToken();
		LName = st.nextToken();
		Age= Integer.parseInt( st.nextToken() );
	}

	@Override
	public boolean equals(Object obj) 
	{
		Person p = (Person)obj;
		boolean ret = false;
		if( this.Id == p.Id && this.FName.equals(p.FName) && this.LName.equals(p.LName) && this.Age == p.Age)
		{
			ret = true;
		}
		return ret;
	}
}
